<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    const fn = (function(){
        const obj = {};
        return function (n){

            obj.name = n;

            return obj;
        }
    })();

    const o1 = fn("成功");
    console.log(o1);
    const o2 = fn("失败");
    console.log(o2);
    const o3 = fn("警告");
    console.log(o3);
    const o4 = fn("提示");
    console.log(o4);

    console.log(o1 === o2);
    console.log(o3 === o2);
    console.log(o4 === o2);
    console.log(o4 === o1);
    console.log(o4 === o3);




</script>
</html>